نوشته شده توسط : dotnek

There are different programming languages, each of which has different features that programmers use in order to achieve their goal, and ultimately lead to the optimization of different sites that cause the user to gain a positive user experience by entering these sites and different programs, that can help you a lot in the field of attracting users so that you can be more successful day by day due to the fact that users will share this good experience with their friends, which will increase the number of visits to the created program or website so that you will be able to earn a good income through this.In order to be able to achieve your goals as a programmer, you need to have the necessary mastery of all the features available in a language and be able to use each of the available features at the right time and place, one of the programming languages that has a lot of fans among different programmers is JavaScript, which will make it possible to convert a page from static to dynamic and cause different users to be able to establish an interactive page. Website developers are always trying to increase their site traffic and attract more users to your website day by day, and with the help of this language they can greatly achieve their goal, in JS, like all existing programming languages, there are various features that if you want to take advantages of them, you have to know each of which as good as possible, some coding in this language may seem complicated, or it may take a long time to write, in which case you can use the libraries available in this language.One of the libraries in this language is jQuery , and if you use it, you can easily enter very complex code and do other things with it, which in this article we are going to mention the elements in it and as well as the way to select elements based on ID, class, attribute, and inheritance , but before we get into that, we need to give you a general definition of jQuery.

What is jQuery?

It is a JavaScript library that has many fans among programmers which allows you to easily navigate files and access predefined features, by using jQuery , it is possible to use existing to make everything simpler due to the fact that you can perform many complex tasks with simple solutions, and with just one line of code you can achieve the desired goals and there is no need to write multiple lines of code, it can also simplify a lot of complicated things from JavaScript, like AJAX calls and DOM manipulation.

What are elements in jQuery?

In this library and any other language, there are different elements that create the content together and all the different changes are implemented on them, in order to apply changes to each of the different elements, we first need to select the elements on which we intend to make different changes, jQuery Selectors lets you select and manipulate HTML elements, they may use names, IDs, classes, etc., in order to select HTML elements, some of which are discussed below, all selectors in jQuery start with a dollar sign and parentheses: $ ().

How to select elements based on ID?

One of the ways in which jQuery selectors can select their desired element, is through ID, in fact, in this case, the selector uses the id attribute of an HTML tag to find the specific element, as you know, the ID is unique to a page, so that, this method is used when you want to select a unique element from all other ones, in order to find out more, review the following example that when a user clicks on a button, the element with id = "test" will be hidden:

<! DOCTYPE html>
<html>
<head>
<script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"> </script>
<script>
$ (document) .ready (function () {
$ ("button"). click (function () {
$ ("# test"). hide ();
});
});
</script>
</head>
<body>

<h2> This is a heading </h2>

<p> This is a paragraph. </p>
<p id = "test"> This is another paragraph. </p>

<button> Click me </button>

</body>
</html>



The result of the example given above is as follows.This is a headingThis is a paragraph.This is another paragraph. 

Read more on:https://www.dotnek.com/Blog/Web/what-are-elements-in-jquery-and-how-to-select

link:https://dotnek.mystrikingly.com/

Related link:Vývoj mobilných hier





:: برچسب‌ها: dotnek , seo , site ,
:: بازدید از این مطلب : 80
|
امتیاز مطلب : 0
|
تعداد امتیازدهندگان : 0
|
مجموع امتیاز : 0
تاریخ انتشار : سه شنبه 19 مرداد 1400 | نظرات ()
مطالب مرتبط با این پست
لیست
می توانید دیدگاه خود را بنویسید


نام
آدرس ایمیل
وب سایت/بلاگ
:) :( ;) :D
;)) :X :? :P
:* =(( :O };-
:B /:) =DD :S
-) :-(( :-| :-))
نظر خصوصی

 کد را وارد نمایید:

آپلود عکس دلخواه: